import req from "@/router/axios.js";

/**
 *
 * @param {Number} params 参数
 * @returns {Function} api
 */
export function base64 (params) {
  return req.post("/admin/sys-file/base64Img", params);
}

/**
 *
 * @param {Number} params 参数
 * @returns {Function} api
 */
export function uploadImg (params) {
  const formData = new FormData();

  for (let p in params) {
    formData.append(p, params[p]);
  }

  return req.post("/admin/sys-file/uploadImg", formData, {
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
}

// 下载帮助文档
// eslint-disable-next-line require-jsdoc
export const dowmloadHelpDoc = () => req.get("/admin/sys-file/developmentDoc");